package com.thon.service.user.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thon.dao.user.SendToDao;
import com.thon.dao.util.Page;
import com.thon.entity.user.Coupon;
import com.thon.entity.user.SendTo;
import com.thon.service.user.SendToService;


@Service
@Transactional
public class SendToServiceImpl implements SendToService{
	@Autowired
	private SendToDao sendToDao;
	
	@Override
	public Page<SendTo> findAllSendToById(int id, int pageNo,int pageSize) {
		Page<SendTo> page = new Page<SendTo>();
		page.setPageNo(pageNo);
		page.setPageSize(pageSize);
		page = sendToDao.findAllSendTo(page, id);
		return page;
	}

	@Override
	public void save(SendTo sendto) {
		sendToDao.save(sendto);
	}

	@Override
	public SendTo getById(int id) {
		return sendToDao.get(id);
	}

	@Override
	public void del(int id) {
		sendToDao.delete(id);
	}

	@Override
	public List<SendTo> listDefaultAddress(int uid, int isDefault) {
		return sendToDao.listDefaultAddress(uid, isDefault);
	}

	@Override
	public List<SendTo> listSendTos(int uid) {
		
		return sendToDao.findSendtoList(uid);
	}

	@Override
	public void update(SendTo sendTo) {
		sendToDao.update(sendTo);
	}
	
	

	

}
